<?php
require 'include/library.inc.php';

header("Content-Type: text/xml;charset=UTF-8");

//this is the normal header applied to any Google sitemap.xml file
echo '<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">';

# Main Pages

echo 
	'
		<url>
		<loc>'.HTML_BASE.'</loc>
		<changefreq>weekly</changefreq>
		<priority>1.0</priority>
		</url>
		
		<url>
		<loc>'.HTML_BASE.'about.php</loc>
		<changefreq>monthly</changefreq>
		<priority>0.8</priority>
		</url>
		
		<url>
		<loc>'.HTML_BASE.'schools.php</loc>
		<changefreq>monthly</changefreq>
		<priority>0.8</priority>
		</url>
		
		<url>
		<loc>'.HTML_BASE.'contacts.php</loc>
		<changefreq>monthly</changefreq>
		<priority>0.8</priority>
		</url>
		
		<url>
		<loc>'.HTML_BASE.'faq.php</loc>
		<changefreq>monthly</changefreq>
		<priority>0.3</priority>
		</url>
	';


# Projects
$sql = 'SELECT
		  sef_url
		FROM
		  schools
		WHERE
		  published
		ORDER BY
		  order_number DESC
	';
$result = query($sql);
while ($row = mysql_fetch_object($result)) {

	$url = HTML_BASE.'school/'.$row->sef_url;


	echo 
	'
		<url>
		<loc>'.$url.'</loc>
		<changefreq>weekly</changefreq>
		<priority>0.6</priority>
		</url>
	';
	
}


echo
'</urlset>';

?>